using HCore.IOC.Context.Event.Attr;
using HCore.Tests.Runtime.DianDianDian.Event;
using HCore.Unity.Behaviour;
using UnityEngine;

namespace HCore.Tests.Runtime.DianDianDian.Game
{
    public class Game : HCoreMonoBehaviour
    {
        [EventListener]
        public void OnGameStartEvent(GameStartEvent @event)
        {
            var enemies = Get("Enemies");
            enemies.SetActive(true);
            foreach (Transform childTransform in enemies.Transform) childTransform.gameObject.SetActive(true);
        }


        [EventListener]
        public void OnCountDownEndEvent(CountDownEndEvent @event)
        {
            Get("Enemies").SetActive(false);
        }

        [EventListener]
        public void OnGamePassEvent(GamePassEvent @event)
        {
            Get("Enemies").SetActive(false);
        }
    }
}